<?php
/*****************************************************************
 * Fusion.Board
 *
 * @author                Denis Wrobel
 * @license               http://www.gnu.org/licenses/gpl-3.0.html
 * @version               0.1
 *
 *****************************************************************/

class Error
{
    public function scriptError( $error_message )
    {
        if( isset( $error_message ) )
        {
            //Display message
            echo '<html><head><style type="text/css">html, body{background-image: url(\'./kernel/error/img/body_bg.jpg\');background-repeat: repeat-x;width: 600px;margin: auto;background-color: #264b8f;}div#container{top: 200px;position: relative;}div#round{-webkit-border-radius: 7px;-moz-border-radius: 7px;border-radius: 7px;background-color: #e9e9e9;width: 600px;padding: 13px;box-shadow: 2px 2px 3px #666666;-moz-box-shadow: 2px 2px 3px #666666;-webkit-box-shadow: 2px 2px 3px #666666;}div#title{font-weight: bold;font-size: 30px;margin-left: 10px;text-shadow: #666666 3px 2px 5px;color: red;}</style></head><body><div id="container"><div id="title">Error</div><div id="round">' . $error_message . '</div></div></body></html>';
        }
        
        die();
    }
    
    public function parserError( $error_id, $error_msg, $error_file, $error_line )
    {
        if( $error_id != 8 )
        {
            $error_message = '[<b>' . $error_id . '</b>] ' . $error_msg . ' in <b>' . $error_file . '</b> on line <b>' . $error_line . '</b>';
            
            echo '<html><head><style type="text/css">html, body{background-image: url(\'./kernel/error/img/body_bg.jpg\');background-repeat: repeat-x;width: 600px;margin: auto;background-color: #264b8f;}div#container{top: 200px;position: relative;}div#round{-webkit-border-radius: 7px;-moz-border-radius: 7px;border-radius: 7px;background-color: #e9e9e9;width: 600px;padding: 13px;box-shadow: 2px 2px 3px #666666;-moz-box-shadow: 2px 2px 3px #666666;-webkit-box-shadow: 2px 2px 3px #666666;}div#title{font-weight: bold;font-size: 30px;margin-left: 10px;text-shadow: #666666 3px 2px 5px;color: red;}</style></head><body><div id="container"><div id="title">Error</div><div id="round">' . $error_message . '</div></div></body></html>';
            die();
        }
    }
}

?>